package wine.logic.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
@Entity
@Cache (usage=CacheConcurrencyStrategy.TRANSACTIONAL)
@Table(name="W_SYS_URL")
public class WSysUrl implements Serializable {
	private static final long serialVersionUID = 1L;
	
	private Long id;
	private String mdlGroup;
	private String mdlName;
	private Long pmsLevel;
	private String url;
	private Long visitCnt;

	private String pmsLevelName="";
	
    public WSysUrl() {
    }

    @Transient
	public String getPmsLevelName() {
    	if(pmsLevel!=null){
    		if(pmsLevel==1L){
    			pmsLevelName="不公开";
    		}else if(pmsLevel==0L){
    			pmsLevelName="公开";
    		}
    	}
		return pmsLevelName;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(unique=true, nullable=false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}


	@Column(name="MDL_GROUP", length=50)
	public String getMdlGroup() {
		return this.mdlGroup;
	}

	public void setMdlGroup(String mdlGroup) {
		this.mdlGroup = mdlGroup;
	}


	@Column(name="MDL_NAME", nullable=false, length=50)
	public String getMdlName() {
		return this.mdlName;
	}

	public void setMdlName(String mdlName) {
		this.mdlName = mdlName;
	}


	@Column(name="PMS_LEVEL", nullable=false, precision=8)
	public Long getPmsLevel() {
		return this.pmsLevel;
	}

	public void setPmsLevel(Long pmsLevel) {
		this.pmsLevel = pmsLevel;
	}


	@Column(nullable=false, length=300)
	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}


	@Column(name="VISIT_CNT", nullable=false, precision=8)
	public Long getVisitCnt() {
		return this.visitCnt;
	}

	public void setVisitCnt(Long visitCnt) {
		this.visitCnt = visitCnt;
	}

}